package com.tangmu.rabbits.ui.fragment.mine;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.TextView;

import com.tangmu.rabbits.R;
import com.tangmu.rabbits.base.BaseOneFragment;
import com.tangmu.rabbits.ui.activity.mine.ClaimedCouponsActivity;
import com.tangmu.rabbits.ui.activity.mine.CollectionActivity;
import com.tangmu.rabbits.ui.activity.mine.CustomerServiceActivity;
import com.tangmu.rabbits.ui.activity.mine.ExchangeActivity;
import com.tangmu.rabbits.ui.activity.mine.FAQActivity;
import com.tangmu.rabbits.ui.activity.mine.GetCouponsGuideActivity;
import com.tangmu.rabbits.ui.activity.mine.IntegralActivity;
import com.tangmu.rabbits.ui.activity.mine.InviteShareActivity;
import com.tangmu.rabbits.ui.activity.mine.MessageActivity;
import com.tangmu.rabbits.ui.activity.mine.NewbieGuideActivity;
import com.tangmu.rabbits.ui.activity.mine.RabbitMoneyActivity;
import com.tangmu.rabbits.ui.activity.mine.SettingsActivity;
import com.tangmu.rabbits.ui.activity.mine.SignInActivity;
import com.tangmu.rabbits.ui.activity.mine.ToAccountActivity;
import com.tangmu.rabbits.ui.activity.mine.TotalEarningsActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * 我的
 */
public class MineFragment extends BaseOneFragment {

    public static final String TAG = "MineFragment";
    // TODO: Rename parameter arguments, choose names that match
    // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
    private static final String ARG_PARAM1 = "param1";
    private static final String ARG_PARAM2 = "param2";
    @BindView(R.id.iv_settings)
    ImageView ivSettings;
    @BindView(R.id.iv_mine_message)
    ImageView ivMineMessage;
    @BindView(R.id.tv_mine_title)
    TextView tvMineTitle;
    @BindView(R.id.tv_sign)
    TextView tvSign;
    @BindView(R.id.tv_mine_tubi)
    TextView tvMineTubi;
    @BindView(R.id.tv_tubi_introduce)
    TextView tvTubiIntroduce;
    @BindView(R.id.view_line)
    View viewLine;
    @BindView(R.id.ll_mine_total_earnings)
    LinearLayout llMineTotalEarnings;
    @BindView(R.id.ll_mine_daoZhang)
    LinearLayout llMineDaoZhang;
    @BindView(R.id.ll_mine_rabbit_exchange)
    LinearLayout llMineRabbitExchange;
    @BindView(R.id.rb_mine_orders)
    RadioButton rbMineOrders;
    @BindView(R.id.rb_mine_coupons)
    RadioButton rbMineCoupons;
    @BindView(R.id.rb_mine_collection)
    RadioButton rbMineCollection;
    @BindView(R.id.rb_mine_cookies)
    RadioButton rbMineCookies;
    //
    @BindView(R.id.rb_mine_integral)
    RadioButton rbMineIntegral;
    @BindView(R.id.rb_mine_invite_share)
    RadioButton rbMineInviteShare;
    @BindView(R.id.rb_mine_coupons_fingerpost)
    RadioButton rbMineCouponsFingerpost;
    @BindView(R.id.rb_mine_custom_center)
    RadioButton rbMineCustomCenter;
    @BindView(R.id.rb_mine_new_fingerpost)
    RadioButton rbMineNewFingerpost;
    @BindView(R.id.rb_mine_faqs)
    RadioButton rbMineFaqs;
    // TODO: Rename and change types of parameters
    private String mParam1;
    private String mParam2;
    @BindView(R.id.ll_mine_header)
    LinearLayout llHeaderView;

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        mImmersionBar.statusBarColor(R.color.transparent).titleBar(llHeaderView).init();
    }

    public MineFragment() {
        // Required empty public constructor
    }

    /**
     * Use this factory method to create a new instance of
     * this fragment using the provided parameters.
     *
     * @param param1 Parameter 1.
     * @param param2 Parameter 2.
     * @return A new instance of fragment MineFragment.
     */
    // TODO: Rename and change types and number of parameters
    public static MineFragment newInstance(String param1, String param2) {
        MineFragment fragment = new MineFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            mParam1 = getArguments().getString(ARG_PARAM1);
            mParam2 = getArguments().getString(ARG_PARAM2);
        }
    }

    @Override
    protected int getLayoutResource() {
        return R.layout.fragment_mine;
    }

    @Override
    protected void initView() {

    }


    @OnClick({R.id.iv_settings, R.id.iv_mine_message, R.id.tv_mine_title, R.id.tv_sign, R.id.tv_mine_tubi, R.id.tv_tubi_introduce,
            R.id.rb_mine_orders, R.id.rb_mine_coupons, R.id.rb_mine_collection, R.id.rb_mine_cookies,
            R.id.ll_mine_total_earnings, R.id.ll_mine_daoZhang, R.id.ll_mine_rabbit_exchange,
            R.id.rb_mine_integral, R.id.rb_mine_invite_share, R.id.rb_mine_coupons_fingerpost, R.id.rb_mine_custom_center, R.id.rb_mine_new_fingerpost, R.id.rb_mine_faqs
    })
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_settings: //设置
                startActivity(SettingsActivity.class);
                break;
            case R.id.iv_mine_message://消息中心
                startActivity(MessageActivity.class);
                break;
            case R.id.tv_mine_title:
                break;
            case R.id.tv_sign: //签到
                startActivity(SignInActivity.class);
                break;
            case R.id.tv_mine_tubi:
                break;
            case R.id.tv_tubi_introduce://兔币介绍
                startActivity(RabbitMoneyActivity.class);
                break;
            case R.id.ll_mine_total_earnings://累计收益
                startActivity(TotalEarningsActivity.class);
                break;
            case R.id.ll_mine_daoZhang://即将到账
                startActivity(ToAccountActivity.class);
                break;
            case R.id.ll_mine_rabbit_exchange://兔币兑换
                startActivity(ExchangeActivity.class);
                break;
            case R.id.rb_mine_orders://我的订单

                break;
            case R.id.rb_mine_coupons://已领优惠券
                startActivity(ClaimedCouponsActivity.class);
                break;
            case R.id.rb_mine_collection://我的收藏
                startActivity(CollectionActivity.class);
                break;
            case R.id.rb_mine_cookies://浏览记录

                break;
            case R.id.rb_mine_integral://我的积分
                startActivity(IntegralActivity.class);
                break;
            case R.id.rb_mine_invite_share://分享邀请
                startActivity(InviteShareActivity.class);
                break;
            case R.id.rb_mine_coupons_fingerpost://领券指南
                startActivity(GetCouponsGuideActivity.class);
                break;
            case R.id.rb_mine_custom_center://客服中心
                startActivity(CustomerServiceActivity.class);
                break;
            case R.id.rb_mine_new_fingerpost://新手指南
                startActivity(NewbieGuideActivity.class);
                break;
            case R.id.rb_mine_faqs://常见问题
                startActivity(FAQActivity.class);
                break;
        }
    }

}
